package com.skivingcloud.workflow.entity;

import org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity;

import java.util.Date;

public class HistoryProcessVo {

    public HistoryProcessVo(HistoricProcessInstanceEntity hpi) {

        this.setId(hpi.getProcessInstanceId());
        this.setKey(hpi.getProcessDefinitionKey());
        this.setProcessName(hpi.getProcessDefinitionName());
        this.setStartTime(hpi.getStartTime());
        this.setEndTime(hpi.getEndTime());
        this.setProcessState(hpi.getEndTime() == null ? "0" : "1");
         if(hpi.getDeleteReason()!=null){
             this.setProcessState("2");
         }
        this.setStartUserId(hpi.getStartUserId());
        this.deleteReason=hpi.getDeleteReason();
        this.processDifinationId=hpi.getProcessDefinitionId();
    }

    private String id;
    private String processName;
    private String key;
    private Date startTime;
    private Date endTime;
    private String processState;
    private String startUserId;
    private String startUserName;
    private String deleteReason;
    private String description;
    private String processDifinationId ;
    private String processId;
    //当前节点
    private String nodeName;
    //当前处理人
    private String curUserName;
    public String getProcessId() {
        return processId;
    }

    public void setProcessId(String processId) {
        this.processId = processId;
    }

    public String getProcessDifinationId() {
        return processDifinationId;
    }

    public void setProcessDifinationId(String processDifinationId) {
        this.processDifinationId = processDifinationId;
    }

    public String getStartUserName() {
        return startUserName;
    }

    public void setStartUserName(String startUserName) {
        this.startUserName = startUserName;
    }

    public String getId() {
        return id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDeleteReason() {
        return deleteReason;
    }

    public void setDeleteReason(String deleteReason) {
        this.deleteReason = deleteReason;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getProcessState() {
        return processState;
    }

    public void setProcessState(String processState) {
        this.processState = processState;
    }

    public String getStartUserId() {
        return startUserId;
    }

    public void setStartUserId(String startUserId) {
        this.startUserId = startUserId;
    }

    /**
     * @return the nodeName
     */
    public String getNodeName() {
        return nodeName;
    }

    /**
     * @param nodeName the nodeName to set
     */
    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    /**
     * @return the curUserName
     */
    public String getCurUserName() {
        return curUserName;
    }

    /**
     * @param curUserName the curUserName to set
     */
    public void setCurUserName(String curUserName) {
        this.curUserName = curUserName;
    }
}
